package cn.lyjuan.first.net.demo._2_netty;

import cn.lyjuan.first.netty.demo._2_netty.Bootstrap;
import cn.lyjuan.first.netty.demo._2_netty.NIOPool;

import java.io.IOException;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

public class Start
{
    public static void main(String[] args) throws IOException
    {
        Executor bossEx = Executors.newFixedThreadPool(2);
        Executor workerEx = Executors.newFixedThreadPool(2);

        // pool
        NIOPool pool = new NIOPool();

        // boss
        pool.initBoss(bossEx, 1);

        // worker
        pool.initWorker(workerEx, 1);

        Bootstrap.init(pool, 8000);
    }
}
